var vm;
var cusId=sessionStorage.getItem("cusId");

$(function () {
   vm = new Vue({
       el:'#cusInfoDiv',
       data:{
           userCode:cusId,
           mobile:'',
           realname:'',
           oaStatus:'',
           registerTime:'',
           bankCNo:'',
           bankName:'',
           bnakMoile:'',
           openAccountTime:'',
           totalAmount:'',
           avaAmount:'',
           froAmount:'',
           cashWait:'',
           proWait:''
       },
       methods:{
       },
       filters: {
           oaStatus: function (value) {
               if (!value) return ''
               switch(value){
                   case 1:
                       return '未开户';
                       break;
                   case 2:
                       return '开户未绑卡';
                       break;
                   case 3:
                       return '已开户';
                       break;
                   case 4:
                       return '待激活';
                       break;
                   case 5:
                       return '开户失败';
                       break;
                   case 6:
                       return '企业开户审核中';
                       break;
                   case 7:
                       return '已开户未签约';
                       break;
               }
           }
       }
   });

    function getData(cusId){
        console.log("getData:id="+cusId);
        $.ajax({
            type: "post",
            contentType: 'application/x-www-form-urlencoded;charset=utf-8',
            url: "../homePage/getCusInfo",
            data: {cusId:cusId},
            dataType: "json",
            success: function (r) {
                console.log(r);
                if (r.code == 0) {
                    var cusInfo=r.cusInfo;
                    vm.userCode=cusInfo.userCode;
                    vm.oaStatus=cusInfo.oaStatus;
                    vm.realname=cusInfo.realname;
                    vm.registerTime=cusInfo.registerTime;
                    vm.bankCNo=cusInfo.bankCNo;
                    vm.bankName=cusInfo.bankName;
                    vm.bnakMoile=cusInfo.bnakMoile;
                    vm.openAccountTime=cusInfo.openAccountTime;
                    vm.totalAmount=cusInfo.totalAmount;
                    vm.avaAmount=cusInfo.avaAmount;
                    vm.froAmount=cusInfo.froAmount;
                    vm.cashWait=cusInfo.cashWait;
                    vm.proWait=cusInfo.proWait;
                    vm.mobile=cusInfo.mobile;
                    return false;
                }
            },
            error:function (r) {
                alert("用户信息查询失败,请刷新重试");
                console.log(r)
            }
        });
    }
    getData(cusId);




});
